package com.company;

import java.util.Scanner;

/**
 * @author jrue
 * @version 1.0
 * @date 2020/3/19 15:49
 */
public class Main12 {

    public static boolean isSub(String s1,String s2) {
        char[] arr = s1.toCharArray();
        int j = -1;
        for(int i = 0;i<arr.length;i++) {
            j = s2.indexOf(arr[i],j+1);
            if(j==-1) {
                return false;
            }
        }
        return true;
    }

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while (sc.hasNext()) {
            String s1 = sc.next();
            String s2 = sc.next();
            String s3 = new StringBuilder(s2).reverse().toString();
            Boolean b = isSub(s2, s1) || isSub(s3, s1);
            System.out.println(String.valueOf(b).toUpperCase());

        }
    }
}
